package com.lib.common.api

import com.lib.common.constant.ApiConstant
import com.lib.common.entity.api.req.*
import com.lib.common.entity.api.resp.*
import com.lib.common.helper.api.ApiResponse
import com.lib.common.helper.api.DomainConfig
import com.lib.framework.network.adapter.request.ApiRequest
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.Body

import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Url


/**
 * Copyright (C), 2019-2020
 * FileName: ApiService
 * Author: Kevin
 * Date: 2020-01-07 11:25
 * Description: 公共的api 接口
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
interface ApiService {

    @POST
    fun postData(@Url url: String, @Body body: RequestBody): ApiRequest<ResponseBody>

    @GET
    fun getData(@Url url: String): Call<GetData02Resp>

    @GET
    fun getData02(@Url url: String): ApiRequest<GetData02Resp>


    /**
     * 获取 腾讯云 cos 的 token
     */
    @POST
    fun cosToken(@Url url: String = ApiConstant.sCosTokenUrl): ApiRequest<ApiResponse<CosTokenResp>>

    /**
     * 获取用户信息接口
     */
    @POST
    fun userinfo(@Url url: String = ApiConstant.sUserinfoUrl): ApiRequest<ApiResponse<UserInfo>>

    /**
     * 检测版本更新
     */
    @POST
    fun checkVersion(@Url url: String = ApiConstant.sCheckVersionUrl, @Body req: CheckVersionReq = CheckVersionReq()): ApiRequest<ApiResponse<CheckVersionResp>>

}